﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAO
{
    public  class CommentAccessoriesDAO
    {
        CameraDBEntities db = new CameraDBEntities();
        public List<CommentAccessory> GetByAll()
        {
            return db.CommentAccessories.ToList();
        }
        public List<CommentAccessory> GetByAll_StatusTrue()
        {
            return db.CommentAccessories.Where(x => x.cmtAccesStatus == true).ToList();
        }

        public List<CommentAccessory> GetByAcc(int id)
        {
            return db.CommentAccessories.Where(x => x.accesId == id && x.cmtAccesStatus == true).ToList();
        }
        public List<CommentAccessory> GetByUserId(int id)
        {
            return db.CommentAccessories.Where(x => x.userId == id && x.cmtAccesStatus == true).ToList(); 
        }

    }
}
